﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="WebApp.Register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

<script language="javascript" type="text/javascript">
    function validateForm() {
        if (document.getElementById("<%=txtuser.ClientID%>").value == "") {
            alert("UserName cannot be blank ^^~♥ !");
            document.getElementById("<%=txtuser.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txtpass.ClientID%>").value == "") {
            alert("Password cannot be blank ^^~♥  !");
            document.getElementById("<%=txtpass.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txtconfirm.ClientID%>").value == "") {
            alert("Confirm Password cannot be blank ^^~♥  !");
            document.getElementById("<%=txtconfirm.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txtname.ClientID%>").value == "") {
            alert("Name cannot be blank ^^~♥  !");
            document.getElementById("<%=txtname.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txtaddress.ClientID%>").value == "") {
            alert("Address cannot be blank ^^~♥  !");
            document.getElementById("<%=txtaddress.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txtphone.ClientID%>").value == "") {
            alert("Phone cannot be blank ^^~♥  !");
            document.getElementById("<%=txtphone.ClientID%>").focus();
            return false;
        }
        
        return true;
    }
    </script>


    <table style="width:100%;">
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label1" runat="server" Text="Username"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtuser" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtpass" runat="server" Width="350px" TextMode="Password"></asp:TextBox>
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label3" runat="server" Text="Confirm Password"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtconfirm" runat="server" Width="350px" TextMode="Password"></asp:TextBox>
            </td>
            <td style="width: 363px">
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ControlToCompare="txtpass" ControlToValidate="txtconfirm" 
                    ErrorMessage="Invalid Password"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label4" runat="server" Text="Name"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtname" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label5" runat="server" Text="Address"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtaddress" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                <asp:Label ID="Label6" runat="server" Text="Phone"></asp:Label>
            </td>
            <td style="width: 262px">
                <asp:TextBox ID="txtphone" runat="server" Width="350px"></asp:TextBox>
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                &nbsp;</td>
            <td style="width: 262px">
                Note: All of field cannot be blank</td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 118px">
                &nbsp;</td>
            <td style="width: 262px">
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="Add_cus" OnClientClick="return validateForm();"/>
                <asp:Button ID="btnreset" runat="server" Text="Reset"  OnClick ="ResetAllFields"  />
                <asp:Button ID="btncancel" runat="server" Text="Cancel" 
                    onclick="btncancel_Click" />
            </td>
            <td style="width: 363px">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
